﻿global using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Http;

using System.Reflection.Metadata;
using System.Security.Claims;
using System.Text;

namespace Logger7;
public class SqlServerLogger : ILogger
{

    private readonly string _CategoryName;
    private readonly SqlServerLoggerProcessor _Process;

    public SqlServerLogger(string categoryName, SqlServerLoggerProcessor processor)
    {
        _CategoryName = categoryName;
        _Process = processor;
    }
    public IDisposable? BeginScope<TState>(TState state) where TState : notnull => default!;


    public bool IsEnabled(LogLevel logLevel) => true;

    public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
    {
        _Process.Write(_CategoryName, logLevel, eventId, state, exception, formatter);
    }
}